package com.xuecheng.content.controller;


import com.xuecheng.base.constant.CourseCategoryConstant;
import com.xuecheng.content.model.dto.CourseCategoryTreeDTO;
import com.xuecheng.content.service.ICourseCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 课程分类 前端控制器
 * @version 1.0
 * @author 勾新杰
 * @since 2024-12-18
 */
@RestController
@RequestMapping("/course-category")
@RequiredArgsConstructor
@Api(value = "课程分类管理接口", tags = "课程分类管理接口")
public class CourseCategoryController {

    private final ICourseCategoryService courseCategoryService; // 课程分类服务

    /**
     * 查询课程分类信息
     * @return 返回所有课程分类信息
     */
    @GetMapping("/tree-nodes")
    @ApiOperation("查询所有课程分类信息")
    public List<CourseCategoryTreeDTO> queryTreeNodes(){
        return courseCategoryService.queryTreeNodes(CourseCategoryConstant.ROOT_ID);
    }
}
